package kz.pompei.ifacer.model.widgets;

import java.io.PrintStream;
import java.util.UUID;

public class WidgetLabel extends Widget {
  public Align side = Align.LEFT;
  public String text = "Метка";
  
  @Override
  protected void printFields(int offset, PrintStream out) {
    String s = space(offset);
    out.println(s + "<side v=\"" + side + "\"/>");
    out.println(s + "<text><![CDATA[" + text + "]]></text>");
  }
  
  public WidgetLabel(UUID uuid) {
    super(uuid);
  }
  
  public WidgetLabel() {}
  
  @Override
  public Widget copy() {
    WidgetLabel ret = new WidgetLabel(uuid);
    assignTo(ret);
    return ret;
  }
  
  @Override
  public void assignTo(Widget widget) {
    checkWidget(widget, getClass());
    super.assignTo(widget);
    WidgetLabel w = (WidgetLabel)widget;
    w.side = side;
    w.text = text;
  }
}
